package cn.fuxi2022.model.vo.auth;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 后端系统登录 与 用户信息 VO
 *
 * @author fuxi
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class UserLoginVo {
    /**
     * 手机号
     */
    @NotNull(message = "手机号码不能为空")
    @Pattern(regexp =
            "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$",
            message = "手机号码范围不正确")
    private String phone;

    /**
     * 密码(加密判断)
     */
    @NotNull(message = "密码不能为空")
    @Size(min = 32, max = 32, message = "密码在MD5加密后的格式非法")
    private String password;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 性别 1 女，2 男，0 未知
     */
    private Integer sex;

    /**
     * 头像
     */
    private String avatar;

}